package com.su.lightthings.bean

/**
 * 手机收到对数据  手表->手机
 * @param currFrame     当前帧数    index:2 length:1
 * @param totalFrame    总帧数     index:3 length:1
 * @param functionFlag  功能标记    index:4 length:1
 * @param checkSum      校验和      index:5 length:2
 * @param packageLength 数据包长度   index:7 length:2
 * @param functionId    功能码      index:9 length:2
 * @param dataLength    数据长度    index:11 length:2
 * @param data          数据       index:13 length:n
 */
data class ReceiveDataBean(
    var currFrame: Int = 1,
    var totalFrame: Int = 1,
    var functionFlag: Int,
    var checkSum: Int,
    var packageLength: Int,
    var functionId: Int,
    var dataLength: Int,
) {
    val dataLongMap = mutableMapOf<String, Long>()
    fun setLongData(key: String, value: Long) {
        dataLongMap[key] = value
    }

    val dataStringMap = mutableMapOf<String, String>()
    fun setStringData(key: String, value: String) {
        dataStringMap[key] = value
    }

    val dataIntListMap = mutableMapOf<String, MutableList<Int>>()
    fun setIntListData(key: String, value: MutableList<Int>) {
        dataIntListMap[key] = value
    }

    val dataBaseDataListMap = mutableMapOf<String, MutableList<BaseDataBean>>()
    fun setBaseDataListData(key: String, value: MutableList<BaseDataBean>) {
        dataBaseDataListMap[key] = value
    }

    val dataGpsDataListMap = mutableMapOf<String, MutableList<GpsBean>>()
    fun setGpsListData(key: String, value: MutableList<GpsBean>) {
        dataGpsDataListMap[key] = value
    }

    val dataAlarmMap = mutableMapOf<String, MutableList<AlarmBean>>()
    fun setAlarmData(key: String, value: MutableList<AlarmBean>) {
        dataAlarmMap[key] = value
    }

    //运动数据
    val sportDataList = mutableListOf<SportDataBean>()
    fun setSportDataList(list: MutableList<SportDataBean>) {
        sportDataList.clear()
        sportDataList.addAll(list.toList())
    }


}

